#include <cstdlib>

template <typename T>
class Node
{
private:
    int end;
    T weight;
    Node* next;
public:
    Node();
    Node(int _end, T _weight);
    ~Node();
    int get_end() const;
    void set_end(int _end);
    T get_weight() const;
    void set_weight(T _weight);
    Node* get_next() const;
    void set_next(Node* _add);

};

template<typename T>
Node<T>::Node()
{
    next = NULL;
};

template<typename T>
Node<T>::Node(int _end, T _weight)
{
    end = _end;
    weight = _weight;
    next = NULL;
};

template<typename T>
Node<T>::~Node()
{
};

template<typename T>
T Node<T>::get_weight() const
{
    return weight;
};

template<typename T>
void Node<T>::set_weight(T _weight)
{
    weight = _weight;
};

template<typename T>
int Node<T>::get_end() const
{
    return end;
};

template<typename T>
void Node<T>::set_end(int _end)
{
    end = _end;
};

template<typename T>
Node<T>* Node<T>::get_next() const
{
    return next;
};

template<typename T>
void Node<T>::set_next(Node<T>* _add)
{
    next = _add;
};
